/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "denomination")
@NamedQueries({
    @NamedQuery(name = "Denomination.findAll", query = "SELECT d FROM Denomination d"),
    @NamedQuery(name = "Denomination.findByIddenomination", query = "SELECT d FROM Denomination d WHERE d.iddenomination = :iddenomination"),
    @NamedQuery(name = "Denomination.findByDenomination", query = "SELECT d FROM Denomination d WHERE d.denomination = :denomination")})
public class Denomination implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "iddenomination")
    private Integer iddenomination;
    @Column(name = "denomination")
    private String denomination;
    @OneToMany(mappedBy = "denomination", fetch = FetchType.LAZY)
    private List<Monitoring> monitoringList;

    public Denomination() {
    }

    public Denomination(Integer iddenomination) {
        this.iddenomination = iddenomination;
    }

    public Integer getIddenomination() {
        return iddenomination;
    }

    public void setIddenomination(Integer iddenomination) {
        this.iddenomination = iddenomination;
    }

    public String getDenomination() {
        return denomination;
    }

    public void setDenomination(String denomination) {
        this.denomination = denomination;
    }

    public List<Monitoring> getMonitoringList() {
        return monitoringList;
    }

    public void setMonitoringList(List<Monitoring> monitoringList) {
        this.monitoringList = monitoringList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddenomination != null ? iddenomination.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Denomination)) {
            return false;
        }
        Denomination other = (Denomination) object;
        if ((this.iddenomination == null && other.iddenomination != null) || (this.iddenomination != null && !this.iddenomination.equals(other.iddenomination))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Denomination[iddenomination=" + iddenomination + "]";
    }

}
